/**
 * 运行环境
 * @type {[type]}
 */
// #ifdef MP-WEIXIN || MP-TOUTIAO
const env = () => {
    try {
        const systemInfo = uni.getSystemInfoSync();
		console.log('systemInfo=',systemInfo)
        const menuButton = uni.getMenuButtonBoundingClientRect();
		console.log('menuButton=',menuButton)
        const height =  menuButton.height + menuButton.top + 6;
        const right =  systemInfo.windowWidth - menuButton.right;
        return Object.assign(systemInfo, {
            NODE_ENV: systemInfo.platform === 'devtools',
            headerInfo: {
                height: height,
                top: menuButton.top,
                bottom: 6,
                right: right,
                paddingRight: right * 2 + menuButton.width,
                menuHeight: menuButton.height,
                menuWidth: menuButton.width
            }
        });
    } catch (err) {
        console.log('CatchClause', err);
        console.log('CatchClause', err);
        console.error(err);
        return {};
    }
};
// #endif

// #ifdef APP-PLUS
const env = () => {
    try {
		const systemInfo = uni.getSystemInfoSync();
		console.log('systemInfo=',systemInfo)
		const menuButton = {
			bottom: 83,
			height: 32,
			left: 296,
			right: 383,
			top: 51,
			width: 87,
		};
		console.log('menuButton========',menuButton)
		const height =  menuButton.height + menuButton.top + 6;
		const right =  systemInfo.windowWidth - menuButton.right;
        return {
			menuButton:menuButton,
			headerInfo: {
			    height: height,
			    top: menuButton.top,
			    bottom: 6,
			    right: right,
			    paddingRight: right * 2 + menuButton.width,
			    menuHeight: menuButton.height,
			    menuWidth: menuButton.width
			}
		}
    } catch (err) {
        return {};
    }
};
// #endif
module.exports = env();
